<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Admin Help Email</title>
<link href="UniversalStyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function SaveClick(){
	te=document.getElementById("TrainingEmail")
	se=document.getElementById("SupportEmail")
	window.location.href="AdminHelpEmail.asp?action=save&training=" + te.value + "&support=" + se.value
}
</script>
</head>

<body>
<p>
 <%
action=request.QueryString("action")
support=request.QueryString("support")
training=request.QueryString("training")
set fs=server.CreateObject("scripting.filesystemobject")

if action="save" then
	set textfile=fs.opentextfile(server.MapPath("access/backend/TrainingEmail.txt"),2,true)
	textfile.writeline(training)
	textfile.close
	
	set textfile=fs.opentextfile(server.MapPath("access/backend/SupportEmail.txt"),2,true)
	textfile.writeline(support)
	textfile.close
	set textfile=nothing
	set fs=nothing
	%>
 <script type="text/javascript">
	alert("Email Addresses Saved.")
	window.location.href="AdminHelpEmail.asp"
	</script>
 <%
else	
	set textfile=fs.opentextfile(server.MapPath("access/backend/TrainingEmail.txt"),1,true)
	te=textfile.readline
	textfile.close

	set textfile=fs.opentextfile(server.MapPath("access/backend/SupportEmail.txt"),1,true)
	se=textfile.readline
	textfile.close

	set textfile=nothing
	set fs=nothing


%>
</p>
<p>&nbsp;</p>
<table width="300" border="1" cellpadding="0" cellspacing="0" bordercolor="#006600" style="border-style:outset; border-width:thin">
  	<tr>
    	<td bgcolor="#FFFFFF"><label><span class="TableTitles">Training Email<br />
      	</span>
      	<input name="TrainingEmail" type="text" id="TrainingEmail" value="<%= te %>" size="40"/>
   	  </label></td>
  	</tr>
  	<tr>
    	<td height="26" bgcolor="#FFFFFF"><label><span class="TableTitles">Software Support Email<br />
      	</span>
      	<input name="SupportEmail" type="text" id="SupportEmail" value="<%= se %>" size="40"/>
   	  </label></td>
  	</tr>
  	<tr>
    	<td bgcolor="#FFFFFF" class="style5"></td>
  	</tr>
  	<tr>
    	<td align="right" bgcolor="#FFFFFF"><img src="Images/SaveButton.png" alt="Save" name="BtnSave" width="60" height="30" id="BtnSave" onclick="SaveClick()"/></td>
  	</tr>
</table>
<%
end if
%>
</body>
</html>
